home *** CD-ROM | disk | FTP | other *** search
/ Amiga News 95 / Amiga News 95.iso / dpat / dpat38 / flushlib / flushlib.c next >
Encoding:
C/C++ Source or Header  |  1993-08-27  |  656 b   |  33 lines

  1.  
  2.  
  3. /*
  4. *
  5. *       Application : FlushLib $
  6. *       Revision    : 1.0 $
  7. *       Version     : 1.0 $
  8. *       Date        : 93/08/27 $
  9. *
  10. *   Copyright (c) 1993 David Scrève
  11. *       All Rights Reserved
  12. */
  13.  
  14.  
  15.  
  16. #include <exec/execbase.h>
  17. #include <clib/exec_protos.h>
  18. #include <clib/alib_stdio_protos.h>
  19.  
  20. extern struct ExecBase * __far SysBase;
  21.  
  22. void main()
  23. {
  24.   struct Library *LibNode;
  25.  
  26.     Forbid();
  27.     for (LibNode=(struct Library *)SysBase->LibList.lh_Head;LibNode;LibNode=(struct Library *)LibNode->lib_Node.ln_Succ)
  28.           if (!LibNode->lib_OpenCnt)
  29.                   RemLibrary(LibNode);
  30.     Permit();
  31.     printf("\nAll Unused Libraries Flushed.\n\n");
  32. }
  33.